home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
201-220
/
scopedisk202
/
bbbbs2
/
rexxdoors
/
one_armed_bandit.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-03-19
|
7KB
|
247 lines
/***************************************/
/* Bandit.rexx Slot Machine Simulator */
/* By: James M. Cates III Oct. 8 1990 */
/* Arexx V1.10 By: William Hawes */
/* Original */
/* Game Bye: M. Soucy and M. Fox. */
/* I found the code heavily 'munged' */
/* So, I did this. It works. */
/***************************************/
CR='0D'x
OPTIONS RESULTS
SIGNAL ON BREAK_C
SIGNAL ON BREAK_E
ARG name purse flag .
IF flag>0 THEN
DO
dollarsign=''
playstuff='TIME SECONDS'
END
ELSE
DO
dollarsign='$'
playstuff='CASH'
END
/**********************************************************************/
/* ANSI.rexx */
/* Simple ANSI color escape function assignments */
/*--------------------------------------------------------------------*/
/* James M. Cates Sept. 24 1990 */
/**********************************************************************/
red = "
" /****************************************/
black = "
" /* These just make life easier when you */
white = "
" /* want some color output. */
rev = "" /****************************************/
def = ""
whred = "
"
whblk = "
"
ital = "
"
under = "
"
say ' 'CR
say ' 'CR
if purse>0 then
say ' Welcome back to the Casino!'CR
else
say ' Welcome to the Casino!'CR
say ' 'CR
say rev'***********************************************************************'CR
say '* __ ___ _ __ __ _ __ _ _ ___ ___ *'CR
say '* / \ |\ | |_ /_\ |__| |\/| |_ | \ |__\ /_\ |\ | | \ | | *'CR
say '* \__/ | \| |__ / \| \ | | |__ |_/ |__/ / \| \| |_/ _|_ | *'CR
say '* *'CR
say '* Revision: Version 1.0 1990 By: James M. Cates III *'CR
say '* Original: Version 0.81 1989 By: M.Soucy and M.Fox *'CR
say '* *'CR
say '***********************************************************************'def||CR
say ' 'CR
say ' 'CR
if purse>0 then call name
say 'Do you need Instructions 'red'('def'Y'red'/'def'N'red')'def' ?'CR
arg
pull ans
do i = 1 to 100
if ans = 'Y' then call inst
else call name
do i = 1 to 100
inst:
say ' 'CR
say ital'C''mon now, this is a simple game. You just follow my prompts.'CR
say 'I''ll do all the real work, all you really have to do is place your bet.'CR
say ' 'CR
say 'The symbols for each slot are a bit funny, they are only symb-'CR
say 'bolic, so don''t worry. I did not feel like doing ascii represen-'CR
say 'ations of FRUIT...'def||CR
call play
play:
say ' 'CR
say 'Do you want to play 'red'('def'Y'red'/'def'N'red')'def' ?'CR
arg
pull ans
if ans = 'Y' then call name
if ans = 'N' then call death
do i = 1 to 100
name:
if purse <10 then purse = 100
bet = 0
Tl = 0
Dl = 0
call Pull
Pull:
say ' 'CR
if purse = 0 then call rating
else
say "Purse =" dollarsign||red|| purse || def" Your bet please "red":"def||CR
pull Bet
if Bet > purse then
do
say ' 'CR
say "Sorry "red||name||def" you can't bet over" dollarsign||red||purse||def||CR
do i = 1 to 100
end
call Pull
end
else
if Bet = 0 | Bet < 0 then call whatthehell
else
if Bet = '' | Bet = ' ' then call Pull
else
say
say ital'Bet taken...'def||CR
call slots
slots:
say ital'Pulling lever for 'under'BIG' playstuff'!'def||CR
call roll
call roll
roll:
slot1 = RANDOM(1,6,Time('s'))
slot2 = RANDOM(1,6,Time('s'))
slot3 = RANDOM(1,6,Time('s'))
call stakes
stakes:
if slot1 = 1 then slot1 = '@'
if slot1 = 2 then slot1 = '?'
if slot1 = 3 then slot1 = '&'
if slot1 = 4 then slot1 = '^'
if slot1 = 5 then slot1 = '_'
if slot1 = 6 then slot1 = '7'
if slot2 = 1 then slot2 = '@'
if slot2 = 2 then slot2 = '?'
if slot2 = 3 then slot2 = '&'
if slot2 = 4 then slot2 = '^'
if slot2 = 5 then slot2 = '_'
if slot2 = 6 then slot2 = '7'
if slot3 = 1 then slot3 = '@'
if slot3 = 2 then slot3 = '?'
if slot3 = 3 then slot3 = '&'
if slot3 = 4 then slot3 = '^'
if slot3 = 5 then slot3 = '_'
if slot3 = 6 then slot3 = '7'
call output
output:
say ' 'CR
say ' <'red slot1 def'> <'red slot2 def'> <'red slot3 def'>'CR
call compare
compare:
if slot1 = slot2 & slot1 ~= slot3 then call winner1
else
if slot2 = slot3 & slot2 ~= slot1 then call winner1
else
if slot1 = slot2 & slot1 = slot3 then call winner2
else purse = (purse - bet)
call Pull
winner1:
say whred'You won double your bet!'def||CR
purse = purse + (bet * 2)
call PDL
call Pull
winner2:
say whred'You won TRIPLE your bet!'def||CR
purse = purse + (bet * 3)
call PTL
call Pull
whatthehell:
say 'Do you want to continue 'red'('def'Y'red'/'def'N'red')'def' ?'CR
do i = 1 to 100
pull ans
arg
if ans = 'Y' then call Pull
else call rating
/**************************************************/
/* Variables to hold count of doubles and triples */
/* These get enabled when 15 doubles or 7 triples */
/* have been reached. This might be pulled, prob- */
/* ably put there to keep BBS users from playing */
/* too long. */
/**************************************************/
PTL:
Tl = Tl + 1
if Tl = 7 then call broken
else call Pull
PDL:
Dl = Dl + 1
if Dl = 15 then call broken
else call Pull
broken:
say ' 'CR
say whblk'The Casino Manager wants to see you!'def||CR
say ' 'CR
do i = 1 to 150
say ital'It appears that he is not happy with you.'CR
say 'You won too much money! Try again later.'def||CR
say ' 'CR
call rating
rating:
if purse > 2000 then RATE = 'Mr. Trump! Your jet is waiting.'
if purse > 1500 & purse <= 2000 then RATE = 'What city are you going to buy?'
if purse > 1000 & purse <= 1500 then RATE = 'Your wallet is fat now!'
if purse > 750 & purse <= 1000 then RATE = 'Pretty good.'
if purse > 500 & purse <= 750 then RATE = 'Well, you did okay.'
if purse > 250 & purse <= 500 then RATE = 'Er..stick to monopoly, eh?'
if purse < 250 & purse >= 100 then RATE = 'You need help!'
if purse < 100 then RATE = 'Hope you have enough for a cab home, sucker!'
say ' '
say 'You had 'dollarsign||red||purse||def' before you quit!'CR
say 'Your rating is : 'ital RATE def||CR
do i = 1 to 200
end
call death
loser:
say ital'Well, you went broke, eh? Come back when you grow up!'def||CR
do i = 1 to 150
call death
BREAK_C:
BREAK_E:
death:
say ' 'CR
say 'You made' dollarsign||red purse def' today!'CR
say 'Goodbye, 'ital||name||def'.'CR
say ' 'CR
CALL SETCLIP('BBS_winnings',purse)
exit
end